import Vue from 'vue';
import VueRouter from 'vue-router';
import Vant from 'vant';

Vue.use(VueRouter);
Vue.use(Vant);

const routes = [
    // 首页
    {
        path: '/',
        name: 'Index',
        component: () => import("@/views/Index")
    },
    // 登录页 
    {
        path: '/login',
        name: 'Login',
        component: () => import("@/views/pages/Login")
    },
    // 注册页
    {
        path: '/register',
        name: 'Register',
        component: () => import("@/views/pages/Register")
    },


    // 个人中心页
    {
        path: '/personal',
        name: 'Personal',
        component: () => import("@/views/personal"),
        meta: {
            auth: true
        }
    },
    // 我的关注页
    {
        path: '/follow',
        name: 'Follow',
        component: () => import("@/views/personal/Follow"),
        meta: {
            auth: true
        }
    },
    // 我的跟帖页
    {
        path: '/comment',
        name: 'Comment',
        component: () => import("@/views/personal/Comment"),
        meta: {
            auth: true
        }
    },
    // 我的收藏页
    {
        path: '/star',
        name: 'Star',
        component: () => import("@/views/personal/Star"),
        meta: {
            auth: true
        }
    },
    // 编辑页
    {
        path: '/edit',
        name: 'Edit',
        component: () => import("@/views/personal/Edit"),
        meta: {
            auth: true
        }
    },
    // 栏目管理页
    {
        path: '/manageList',
        name: 'ManageList',
        component: () => import("@/views/personal/ManageList"),
        meta: {
            auth: true
        }
    },


    // 文章详情页
    {
        path: '/postDetail/:id',
        name: 'PostDetail',
        component: () => import("@/views/main/PostDetail"),
        meta: {
            auth: true
        }
    },
    // 更多跟帖页
    {
        path: '/moreComment/:id',
        name: 'MoreComment',
        component: () => import("@/views/main/MoreComment"),
        meta: {
            auth: true
        }
    },
    // 搜索页
    {
        path: '/search',
        name: 'Search',
        component: () => import("@/views/main/Search"),
        meta: {
            auth: true
        }
    },



    // 测试页(关注请求)
    {
        path: '/followTest',
        name: 'FollowTest',
        component: () => import("@/views/personal/FollowTest"),
        meta: {
            auth: true
        }
    },

    // 测试页(评论页递归)
    {
        path: '/test',
        name: 'Test',
        component: () => import("@/views/Test")
    }

]

const router = new VueRouter({
    routes
})

export default router